<template>
  <view>
    <cu-custom :bgColor="'bg-' + theme.backgroundColor" :isBack="true"
      ><block slot="content">{{ title }}</block></cu-custom
    >
    <view class="margin-top-xl">
      <web-view :src="url" :webview-styles="webviewStyles"></web-view>
    </view>
  </view>
</template>
<script>
// #ifndef MP
const app = getApp();
// #endif
export default {
  data() {
    return {
      // #ifndef MP
      theme: app.globalData.theme, //全局颜色变量
      // #endif
      url: "",
      title: "浏览",
      webviewStyles: {
        progress: {
          color: "#FF3333",
        },
      },
    };
  },
  onShow() {},
  onLoad: function (option) {
    if (option.webUrl) {
      let webUrl = decodeURIComponent(option.webUrl);
      this.url = webUrl || "";
    }
    if (option.title) {
      this.title = option.title;
      uni.setNavigationBarTitle({
        title: option.title,
      });
    }
  },
  methods: {},
};
</script>
<style></style>
